home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-31 | 1.0 KB | 50 lines | [TEXT/MPS ] |
- !!MP Inlines.f
-
- C An example of a FORTRAN Resource for Microsoft Excel 3.0
- C This example call illustrates the use of zero terminated
- C strings - Data Type C. This resource returns the length of
- C zero terminated string. This does not handle strings with a
- C length of greater than 32767.
- C
- C Testing for this example was done with
- C Language Systems FORTRAN version 3.0
- C
- C Below are the commands that were executed to create the
- C code resource
-
- !!IFC FALSE
- FORTRAN DATAC.f -opt=1 -noimplicit
- Link -w -f -srt -ad 4 -t '????' -c '????' ∂
- -m DATAC -sn Main=DATAC ∂
- -sn f_RunTime=DATAC ∂
- -sn f_Intrinsics=DATAC ∂
- DATAC.f.o ∂
- "{FLibraries}"OutpwStubs.o ∂
- "{Libraries}"Runtime.o ∂
- "{Libraries}"Interface.o ∂
- "{FLibraries}"FORTRANlib.o ∂
- "{FLibraries}"IntrinsicLib.o ∂
- "{FLibraries}"FSANELib.o ∂
- -o DATAC.rsc
-
- !!ENDC
-
- C Source code
-
- integer*2 function DATAC(%val(a))
-
- integer where
- pointer /character*32767/ a
-
- where = index(a^,char(0))
- if (where.EQ.0) then
- DATAC = INT2(NAN(1))
- else
- DATAC = where - 1
- endif
-
- return
- end
-
-
-